from droite import *
from plot import *

def tests_texte():
	print "Test 1 - eq de droite"
	print droite((-2,0),(1,1.5))
	print droite((-2,0),(-2,0))
	print "Test 2 - appartenance (TTF)"
	print appartient((-.5, 1, 1.0), (-2,0))
	print appartient((-.5, 1, 1.0), (1,1.5))
	print appartient((-.5, 1, 1.0), (0,0))
	print "Test 3 - parallelisme (TF)"
	print paralleles((0,1,1), (0,2,3))
	print paralleles((-.5,1,1.0), (0,2,3))
	print "Test 4 - intersection"
	print intersection((-.5, 1, 1.0),(0,2,3))
	print intersection((0, 1, 1),(0,2,3))
	print "Test 5 - droiteNormale"
	print droiteNormale((-.5, 1, 1.0), (-2,0))
	print droiteNormale((-.5, 1, 1.0), (3,4))
	print "Test 6 - symetrieOrtho"
	print symetrieOrthogonale((-.5, 1, 1.0), (-2,0))
	print symetrieOrthogonale((-.5, 1, 1.0), (3,4))
	print "Test 7 - distanceDroitePoint"
	print distanceDroitePoint((-.5, 1, 1.0), (3,4))
	print distanceDroitePoint((-.5, 1, 1.0), (-2,0))
	print "Test Bonus - confondues"
	print confondues((1,2,3), (4,8,12))==True
	print "Test Bonus - parallele"
	print paralleles((1,1,0),droiteParallele((1,1,0),(7,5)))==True
	print "Test Bonus - inter abscisses"
	print intersectionAbscisses((2,3,7))

def dessin():
	p = Plot()
	p.prepare((1,1,3))
	p.prepare((-2,1,-1))
	p.draw()
	while (1):
		pass
	#x = raw_input()

def test_para():
	p1=(-1,0)
	p2=(1,1)
	p3=(-1,-1)
	p4=(1,-1)
	print verifierPara(p1,p2,p3,p4)==True
	
	
tests_texte()
